]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Add shortcut for toggling quick settings
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 21 Mar 2023 16:07:19 +0000 (17:07 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 21 Jun 2023 18:11:05 +0000 (18:11 +0000)
Ever since the various status menus were combined into a single
aggregate menu, the menu has been an important entry point. Alas,
we never got around to adding a shortcut for it, not least because
there never was a good candidate.

We just freed super+s which works as either "system" or
"(quick) settings", so use that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5670

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2716>

data/50-gnome-shell-system.xml
data/org.gnome.shell.gschema.xml.in
js/ui/panel.js
js/ui/windowManager.js

index 1dbb31118a56bc199d6e0d33e0d8f3ff5848a827..acac8724708f9d9449b94627263f3a3d8e7449ca 100644 (file)
@@ -8,6 +8,9 @@
        <KeyListEntry name="toggle-message-tray"
                       description="Show the notification list"/>
 
+       <KeyListEntry name="toggle-quick-settings"
+                      description="Open the quick settings menu"/>
+
        <KeyListEntry name="focus-active-notification"
                       description="Focus the active notification"/>
 
index 8d782fbf9c9009c72a786f66c7f21c08979d1cdc..baab1687ab5cc6dc1457fb2fd3057b1c3fae0dba 100644 (file)
         Keybinding to toggle the visibility of the notification list.
       </description>
     </key>
+    <key name="toggle-quick-settings" type="as">
+      <default>["&lt;Super&gt;s"]</default>
+      <summary>Keybinding to toggle the quick settings menu</summary>
+      <description>
+        Keybinding to toggle the quick settings menu.
+      </description>
+    </key>
     <key name="focus-active-notification" type="as">
       <default>["&lt;Super&gt;n"]</default>
       <summary>Keybinding to focus the active notification</summary>
index 13243350661c5be580635e942742b88c63972393..33906836025e0ba642a44b3adfac1a1a9b3182d3 100644 (file)
@@ -640,6 +640,10 @@ class Panel extends St.Widget {
         this._toggleMenu(this.statusArea.dateMenu);
     }
 
+    toggleQuickSettings() {
+        this._toggleMenu(this.statusArea.quickSettings);
+    }
+
     closeCalendar() {
         this._closeMenu(this.statusArea.dateMenu);
     }
index fe4117146c9f1cbf1196289accdff19f567193ab..12787dc9511b7ce0626ab86dde66da003db59631 100644 (file)
@@ -812,6 +812,13 @@ var WindowManager = class {
             Shell.ActionMode.POPUP,
             this._toggleCalendar.bind(this));
 
+        this.addKeybinding('toggle-quick-settings',
+            new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
+            Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
+            Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW |
+            Shell.ActionMode.POPUP,
+            this._toggleQuickSettings.bind(this));
+
         this.addKeybinding('switch-to-application-1',
             new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
             Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
@@ -1723,6 +1730,10 @@ var WindowManager = class {
         Main.panel.toggleCalendar();
     }
 
+    _toggleQuickSettings() {
+        Main.panel.toggleQuickSettings();
+    }
+
     _showWorkspaceSwitcher(display, window, binding) {
         let workspaceManager = display.get_workspace_manager();